package com.micro.monitoring.basic;

import android.content.Context;
import android.content.SharedPreferences;

import com.micro.monitoring.Constant;

public class BasicSharePreferences {
    private  static SharedPreferences sharedPreferences;
    private  static SharedPreferences.Editor editor;

    public static SharedPreferences getSharedPreferences(Context context) {
        if (sharedPreferences==null) {
            sharedPreferences=context.getSharedPreferences(Constant.PREFS_NAME, Context.MODE_PRIVATE);
        }
        return sharedPreferences;
    }


    public static SharedPreferences.Editor getEditor(Context context) {
        if (editor==null){
            if (sharedPreferences==null){
                getSharedPreferences(context);
            }
            editor=sharedPreferences.edit();
        }
        return editor;
    }

}
